<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 702
</span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">#if __GLASGOW_HASKELL__ &gt;= 706
</span><span class="hs-pragma">{-# LANGUAGE PolyKinds #-}</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">#if __GLASGOW_HASKELL__ &gt;= 710
</span><span class="hs-pragma">{-# LANGUAGE AutoDeriveTypeable #-}</span><span class="hs-cpp">
#endif
</span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Module      :  Control.Applicative.Backwards</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Copyright   :  (c) Russell O'Connor 2009</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- License     :  BSD-style (see the file LICENSE)</span><span>
</span><span id="line-16"></span><span class="hs-comment">--</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- Maintainer  :  R.Paterson@city.ac.uk</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- Stability   :  experimental</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-20"></span><span class="hs-comment">--</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- Making functors with an 'Applicative' instance that performs actions</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- in the reverse order.</span><span>
</span><span id="line-23"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Control.Applicative.Backwards</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-26"></span><span>    </span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier">Backwards</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#"><span class="hs-identifier">Data.Functor.Classes</span></a></span><span class="hs-cpp">
#if MIN_VERSION_base(4,12,0)
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Contravariant.html#"><span class="hs-identifier">Data.Functor.Contravariant</span></a></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier">foldr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#foldr1"><span class="hs-identifier">foldr1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#foldl"><span class="hs-identifier">foldl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#foldl1"><span class="hs-identifier">foldl1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier">null</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier">length</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Applicative.html#"><span class="hs-identifier">Control.Applicative</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#"><span class="hs-identifier">Data.Foldable</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Traversable.html#"><span class="hs-identifier">Data.Traversable</span></a></span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-comment">-- | The same functor, but with an 'Applicative' instance that performs</span><span>
</span><span id="line-40"></span><span class="hs-comment">-- actions in the reverse order.</span><span>
</span><span id="line-41"></span><span class="hs-keyword">newtype</span><span> </span><span id="Backwards"><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-var">Backwards</span></a></span></span><span> </span><span id="local-6989586621679073070"><span class="annot"><a href="#local-6989586621679073070"><span class="hs-identifier hs-type">f</span></a></span></span><span> </span><span id="local-6989586621679073069"><span class="annot"><a href="#local-6989586621679073069"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Backwards"><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-var">Backwards</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="forwards"><span class="annot"><span class="annottext">forall {k} (f :: k -&gt; *) (a :: k). Backwards f a -&gt; f a
</span><a href="Control.Applicative.Backwards.html#forwards"><span class="hs-identifier hs-var hs-var">forwards</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679073070"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073069"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span id="local-6989586621679073061"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Eq1"><span class="hs-identifier hs-type">Eq1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073061"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Eq1"><span class="hs-identifier hs-type">Eq1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073061"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-44"></span><span>    </span><span id="local-6989586621679072816"><span class="annot"><span class="annottext">liftEq :: forall a b.
(a -&gt; b -&gt; Bool) -&gt; Backwards f a -&gt; Backwards f b -&gt; Bool
</span><a href="../../base/src/Data.Functor.Classes.html#liftEq"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftEq</span></a></span></span><span> </span><span id="local-6989586621679072814"><span class="annot"><span class="annottext">a -&gt; b -&gt; Bool
</span><a href="#local-6989586621679072814"><span class="hs-identifier hs-var">eq</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072813"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072813"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072812"><span class="annot"><span class="annottext">f b
</span><a href="#local-6989586621679072812"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b -&gt; Bool) -&gt; f a -&gt; f b -&gt; Bool
forall (f :: * -&gt; *) a b.
Eq1 f =&gt;
(a -&gt; b -&gt; Bool) -&gt; f a -&gt; f b -&gt; Bool
</span><a href="../../base/src/Data.Functor.Classes.html#liftEq"><span class="hs-identifier hs-var">liftEq</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; Bool
</span><a href="#local-6989586621679072814"><span class="hs-identifier hs-var">eq</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072813"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">f b
</span><a href="#local-6989586621679072812"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-45"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#liftEq"><span class="hs-pragma hs-type">liftEq</span></a></span><span> </span><span class="hs-pragma">#-}</span></span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span id="local-6989586621679073054"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Ord1"><span class="hs-identifier hs-type">Ord1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073054"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Ord1"><span class="hs-identifier hs-type">Ord1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073054"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-48"></span><span>    </span><span id="local-6989586621679072803"><span class="annot"><span class="annottext">liftCompare :: forall a b.
(a -&gt; b -&gt; Ordering) -&gt; Backwards f a -&gt; Backwards f b -&gt; Ordering
</span><a href="../../base/src/Data.Functor.Classes.html#liftCompare"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftCompare</span></a></span></span><span> </span><span id="local-6989586621679072801"><span class="annot"><span class="annottext">a -&gt; b -&gt; Ordering
</span><a href="#local-6989586621679072801"><span class="hs-identifier hs-var">comp</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072800"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072800"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072799"><span class="annot"><span class="annottext">f b
</span><a href="#local-6989586621679072799"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b -&gt; Ordering) -&gt; f a -&gt; f b -&gt; Ordering
forall (f :: * -&gt; *) a b.
Ord1 f =&gt;
(a -&gt; b -&gt; Ordering) -&gt; f a -&gt; f b -&gt; Ordering
</span><a href="../../base/src/Data.Functor.Classes.html#liftCompare"><span class="hs-identifier hs-var">liftCompare</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; Ordering
</span><a href="#local-6989586621679072801"><span class="hs-identifier hs-var">comp</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072800"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">f b
</span><a href="#local-6989586621679072799"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-49"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#liftCompare"><span class="hs-pragma hs-type">liftCompare</span></a></span><span> </span><span class="hs-pragma">#-}</span></span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span id="local-6989586621679073044"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679072792"><span id="local-6989586621679072794"><span id="local-6989586621679072796"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Read1"><span class="hs-identifier hs-type">Read1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073044"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Read1"><span class="hs-identifier hs-type">Read1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073044"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-52"></span><span>    </span><span id="local-6989586621679072789"><span class="annot"><span class="annottext">liftReadsPrec :: forall a.
(Int -&gt; ReadS a) -&gt; ReadS [a] -&gt; Int -&gt; ReadS (Backwards f a)
</span><a href="../../base/src/Data.Functor.Classes.html#liftReadsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftReadsPrec</span></a></span></span><span> </span><span id="local-6989586621679072787"><span class="annot"><span class="annottext">Int -&gt; ReadS a
</span><a href="#local-6989586621679072787"><span class="hs-identifier hs-var">rp</span></a></span></span><span> </span><span id="local-6989586621679072786"><span class="annot"><span class="annottext">ReadS [a]
</span><a href="#local-6989586621679072786"><span class="hs-identifier hs-var">rl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; ReadS (Backwards f a)) -&gt; Int -&gt; ReadS (Backwards f a)
forall a. (String -&gt; ReadS a) -&gt; Int -&gt; ReadS a
</span><a href="../../base/src/Data.Functor.Classes.html#readsData"><span class="hs-identifier hs-var">readsData</span></a></span><span> </span><span class="annot"><span class="annottext">((String -&gt; ReadS (Backwards f a)) -&gt; Int -&gt; ReadS (Backwards f a))
-&gt; (String -&gt; ReadS (Backwards f a))
-&gt; Int
-&gt; ReadS (Backwards f a)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-53"></span><span>        </span><span class="annot"><span class="annottext">(Int -&gt; ReadS (f a))
-&gt; String
-&gt; (f a -&gt; Backwards f a)
-&gt; String
-&gt; ReadS (Backwards f a)
forall a t.
(Int -&gt; ReadS a) -&gt; String -&gt; (a -&gt; t) -&gt; String -&gt; ReadS t
</span><a href="../../base/src/Data.Functor.Classes.html#readsUnaryWith"><span class="hs-identifier hs-var">readsUnaryWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Int -&gt; ReadS a) -&gt; ReadS [a] -&gt; Int -&gt; ReadS (f a)
forall (f :: * -&gt; *) a.
Read1 f =&gt;
(Int -&gt; ReadS a) -&gt; ReadS [a] -&gt; Int -&gt; ReadS (f a)
</span><a href="../../base/src/Data.Functor.Classes.html#liftReadsPrec"><span class="hs-identifier hs-var">liftReadsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; ReadS a
</span><a href="#local-6989586621679072787"><span class="hs-identifier hs-var">rp</span></a></span><span> </span><span class="annot"><span class="annottext">ReadS [a]
</span><a href="#local-6989586621679072786"><span class="hs-identifier hs-var">rl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Backwards&quot;</span></span><span> </span><span class="annot"><span class="annottext">f a -&gt; Backwards f a
forall {k} (f :: k -&gt; *) (a :: k). f a -&gt; Backwards f a
</span><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-var">Backwards</span></a></span></span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span id="local-6989586621679073032"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679072781"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Show1"><span class="hs-identifier hs-type">Show1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073032"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Show1"><span class="hs-identifier hs-type">Show1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073032"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-56"></span><span>    </span><span id="local-6989586621679072778"><span class="annot"><span class="annottext">liftShowsPrec :: forall a.
(Int -&gt; a -&gt; ShowS)
-&gt; ([a] -&gt; ShowS) -&gt; Int -&gt; Backwards f a -&gt; ShowS
</span><a href="../../base/src/Data.Functor.Classes.html#liftShowsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftShowsPrec</span></a></span></span><span> </span><span id="local-6989586621679072776"><span class="annot"><span class="annottext">Int -&gt; a -&gt; ShowS
</span><a href="#local-6989586621679072776"><span class="hs-identifier hs-var">sp</span></a></span></span><span> </span><span id="local-6989586621679072775"><span class="annot"><span class="annottext">[a] -&gt; ShowS
</span><a href="#local-6989586621679072775"><span class="hs-identifier hs-var">sl</span></a></span></span><span> </span><span id="local-6989586621679072774"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679072774"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072773"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072773"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-57"></span><span>        </span><span class="annot"><span class="annottext">(Int -&gt; f a -&gt; ShowS) -&gt; String -&gt; Int -&gt; f a -&gt; ShowS
forall a. (Int -&gt; a -&gt; ShowS) -&gt; String -&gt; Int -&gt; a -&gt; ShowS
</span><a href="../../base/src/Data.Functor.Classes.html#showsUnaryWith"><span class="hs-identifier hs-var">showsUnaryWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Int -&gt; a -&gt; ShowS) -&gt; ([a] -&gt; ShowS) -&gt; Int -&gt; f a -&gt; ShowS
forall (f :: * -&gt; *) a.
Show1 f =&gt;
(Int -&gt; a -&gt; ShowS) -&gt; ([a] -&gt; ShowS) -&gt; Int -&gt; f a -&gt; ShowS
</span><a href="../../base/src/Data.Functor.Classes.html#liftShowsPrec"><span class="hs-identifier hs-var">liftShowsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; a -&gt; ShowS
</span><a href="#local-6989586621679072776"><span class="hs-identifier hs-var">sp</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; ShowS
</span><a href="#local-6989586621679072775"><span class="hs-identifier hs-var">sl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Backwards&quot;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679072774"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072773"><span class="hs-identifier hs-var">x</span></a></span></span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span id="local-6989586621679073027"><span id="local-6989586621679073028"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679072769"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Eq1"><span class="hs-identifier hs-type">Eq1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073028"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="annot"><a href="#local-6989586621679073027"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073028"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073027"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679072765"><span class="annot"><span class="annottext">== :: Backwards f a -&gt; Backwards f a -&gt; Bool
</span><span class="hs-operator hs-var hs-var hs-var hs-var">(==)</span></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Backwards f a -&gt; Backwards f a -&gt; Bool
forall (f :: * -&gt; *) a. (Eq1 f, Eq a) =&gt; f a -&gt; f a -&gt; Bool
</span><a href="../../base/src/Data.Functor.Classes.html#eq1"><span class="hs-identifier hs-var">eq1</span></a></span></span></span><span>
</span><span id="line-60"></span><span id="local-6989586621679073022"><span id="local-6989586621679073023"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679072749"><span id="local-6989586621679072751"><span id="local-6989586621679072753"><span id="local-6989586621679072755"><span id="local-6989586621679072757"><span id="local-6989586621679072759"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Ord1"><span class="hs-identifier hs-type">Ord1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073023"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Ord</span></span><span> </span><span class="annot"><a href="#local-6989586621679073022"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Ord</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073023"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073022"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span></span></span></span><span> </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679072745"><span class="annot"><span class="annottext">compare :: Backwards f a -&gt; Backwards f a -&gt; Ordering
</span><span class="hs-identifier hs-var hs-var hs-var hs-var">compare</span></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Backwards f a -&gt; Backwards f a -&gt; Ordering
forall (f :: * -&gt; *) a. (Ord1 f, Ord a) =&gt; f a -&gt; f a -&gt; Ordering
</span><a href="../../base/src/Data.Functor.Classes.html#compare1"><span class="hs-identifier hs-var">compare1</span></a></span></span></span><span>
</span><span id="line-61"></span><span id="local-6989586621679073017"><span id="local-6989586621679073018"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679072736"><span id="local-6989586621679072738"><span id="local-6989586621679072740"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Read1"><span class="hs-identifier hs-type">Read1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073018"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Read.html#Read"><span class="hs-identifier hs-type">Read</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073017"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Read.html#Read"><span class="hs-identifier hs-type">Read</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073018"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073017"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span><span> </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679072732"><span class="annot"><span class="annottext">readsPrec :: Int -&gt; ReadS (Backwards f a)
</span><a href="../../base/src/GHC.Read.html#readsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">readsPrec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; ReadS (Backwards f a)
forall (f :: * -&gt; *) a. (Read1 f, Read a) =&gt; Int -&gt; ReadS (f a)
</span><a href="../../base/src/Data.Functor.Classes.html#readsPrec1"><span class="hs-identifier hs-var">readsPrec1</span></a></span></span></span><span>
</span><span id="line-62"></span><span id="local-6989586621679073012"><span id="local-6989586621679073013"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679072725"><span id="local-6989586621679072727"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Show1"><span class="hs-identifier hs-type">Show1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073013"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073012"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073013"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073012"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679072721"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; Backwards f a -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#showsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Backwards f a -&gt; ShowS
forall (f :: * -&gt; *) a. (Show1 f, Show a) =&gt; Int -&gt; f a -&gt; ShowS
</span><a href="../../base/src/Data.Functor.Classes.html#showsPrec1"><span class="hs-identifier hs-var">showsPrec1</span></a></span></span></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="hs-comment">-- | Derived instance.</span><span>
</span><span id="line-65"></span><span id="local-6989586621679073004"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679072716"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073004"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679073004"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-66"></span><span>    </span><span id="local-6989586621679072713"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; Backwards f a -&gt; Backwards f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679072712"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679072712"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072711"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072711"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">f b -&gt; Backwards f b
forall {k} (f :: k -&gt; *) (a :: k). f a -&gt; Backwards f a
</span><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-var">Backwards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; f a -&gt; f b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679072712"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072711"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-67"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-pragma hs-type">fmap</span></a></span><span> </span><span class="hs-pragma">#-}</span></span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span class="hs-comment">-- | Apply @f@-actions in the reverse order.</span><span>
</span><span id="line-70"></span><span id="local-6989586621679072990"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679072701"><span id="local-6989586621679072703"><span id="local-6989586621679072705"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679072990"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679072990"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-71"></span><span>    </span><span id="local-6989586621679072698"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; Backwards f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621679072697"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679072697"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">f a -&gt; Backwards f a
forall {k} (f :: k -&gt; *) (a :: k). f a -&gt; Backwards f a
</span><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-var">Backwards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; f a
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679072697"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-72"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#pure"><span class="hs-pragma hs-type">pure</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-73"></span><span>    </span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072695"><span class="annot"><span class="annottext">f (a -&gt; b)
</span><a href="#local-6989586621679072695"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679072694"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. Backwards f (a -&gt; b) -&gt; Backwards f a -&gt; Backwards f b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></a></span></span><span> </span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072693"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072693"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">f b -&gt; Backwards f b
forall {k} (f :: k -&gt; *) (a :: k). f a -&gt; Backwards f a
</span><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-var">Backwards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072693"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">f a -&gt; f (a -&gt; b) -&gt; f b
forall (f :: * -&gt; *) a b. Applicative f =&gt; f a -&gt; f (a -&gt; b) -&gt; f b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%2A%3E"><span class="hs-operator hs-var">&lt;**&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">f (a -&gt; b)
</span><a href="#local-6989586621679072695"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-74"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;*&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span></span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span class="hs-comment">-- | Try alternatives in the same order as @f@.</span><span>
</span><span id="line-77"></span><span id="local-6989586621679072979"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679072684"><span id="local-6989586621679072686"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679072979"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679072979"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-78"></span><span>    </span><span id="local-6989586621679072681"><span class="annot"><span class="annottext">empty :: forall a. Backwards f a
</span><a href="../../base/src/GHC.Base.html#empty"><span class="hs-identifier hs-var hs-var hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">f a -&gt; Backwards f a
forall {k} (f :: k -&gt; *) (a :: k). f a -&gt; Backwards f a
</span><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-var">Backwards</span></a></span><span> </span><span class="annot"><span class="annottext">f a
forall (f :: * -&gt; *) a. Alternative f =&gt; f a
</span><a href="../../base/src/GHC.Base.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-79"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#empty"><span class="hs-pragma hs-type">empty</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-80"></span><span>    </span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072678"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072678"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679072677"><span class="annot"><span class="annottext">&lt;|&gt; :: forall a. Backwards f a -&gt; Backwards f a -&gt; Backwards f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;|&gt;</span></a></span></span><span> </span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072675"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072675"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">f a -&gt; Backwards f a
forall {k} (f :: k -&gt; *) (a :: k). f a -&gt; Backwards f a
</span><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-var">Backwards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072678"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">f a -&gt; f a -&gt; f a
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072675"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-81"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="hs-pragma">(</span><span class="hs-pragma">&lt;|&gt;</span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">#-}</span></span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="hs-comment">-- | Derived instance.</span><span>
</span><span id="line-84"></span><span id="local-6989586621679072961"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679072648"><span id="local-6989586621679072650"><span id="local-6989586621679072652"><span id="local-6989586621679072654"><span id="local-6989586621679072656"><span id="local-6989586621679072660"><span id="local-6989586621679072664"><span id="local-6989586621679072667"><span id="local-6989586621679072670"><span id="local-6989586621679072673"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679072961"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679072961"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span></span></span></span></span></span></span></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-85"></span><span>    </span><span id="local-6989586621679072643"><span class="annot"><span class="annottext">foldMap :: forall m a. Monoid m =&gt; (a -&gt; m) -&gt; Backwards f a -&gt; m
</span><a href="../../base/src/Data.Foldable.html#foldMap"><span class="hs-identifier hs-var hs-var hs-var hs-var">foldMap</span></a></span></span><span> </span><span id="local-6989586621679072641"><span class="annot"><span class="annottext">a -&gt; m
</span><a href="#local-6989586621679072641"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072640"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072640"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; m) -&gt; f a -&gt; m
forall (t :: * -&gt; *) m a.
(Foldable t, Monoid m) =&gt;
(a -&gt; m) -&gt; t a -&gt; m
</span><a href="../../base/src/Data.Foldable.html#foldMap"><span class="hs-identifier hs-var">foldMap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; m
</span><a href="#local-6989586621679072641"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072640"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-86"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#foldMap"><span class="hs-pragma hs-type">foldMap</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-87"></span><span>    </span><span id="local-6989586621679072638"><span class="annot"><span class="annottext">foldr :: forall a b. (a -&gt; b -&gt; b) -&gt; b -&gt; Backwards f a -&gt; b
</span><a href="#local-6989586621679072638"><span class="hs-identifier hs-var hs-var hs-var hs-var">foldr</span></a></span></span><span> </span><span id="local-6989586621679072637"><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679072637"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679072636"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679072636"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072635"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072635"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b -&gt; b) -&gt; b -&gt; f a -&gt; b
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; b
</span><a href="#local-6989586621679072637"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679072636"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072635"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-88"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-pragma hs-type">foldr</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-89"></span><span>    </span><span id="local-6989586621679072633"><span class="annot"><span class="annottext">foldl :: forall b a. (b -&gt; a -&gt; b) -&gt; b -&gt; Backwards f a -&gt; b
</span><a href="#local-6989586621679072633"><span class="hs-identifier hs-var hs-var hs-var hs-var">foldl</span></a></span></span><span> </span><span id="local-6989586621679072632"><span class="annot"><span class="annottext">b -&gt; a -&gt; b
</span><a href="#local-6989586621679072632"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679072631"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679072631"><span class="hs-identifier hs-var">z</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072630"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072630"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(b -&gt; a -&gt; b) -&gt; b -&gt; f a -&gt; b
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl"><span class="hs-identifier hs-var">foldl</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; a -&gt; b
</span><a href="#local-6989586621679072632"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679072631"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072630"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-90"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#foldl"><span class="hs-pragma hs-type">foldl</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-91"></span><span>    </span><span id="local-6989586621679072628"><span class="annot"><span class="annottext">foldr1 :: forall a. (a -&gt; a -&gt; a) -&gt; Backwards f a -&gt; a
</span><a href="#local-6989586621679072628"><span class="hs-identifier hs-var hs-var hs-var hs-var">foldr1</span></a></span></span><span> </span><span id="local-6989586621679072627"><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679072627"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072626"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072626"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; a) -&gt; f a -&gt; a
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; a -&gt; a) -&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#foldr1"><span class="hs-identifier hs-var">foldr1</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679072627"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072626"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-92"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#foldr1"><span class="hs-pragma hs-type">foldr1</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-93"></span><span>    </span><span id="local-6989586621679072624"><span class="annot"><span class="annottext">foldl1 :: forall a. (a -&gt; a -&gt; a) -&gt; Backwards f a -&gt; a
</span><a href="#local-6989586621679072624"><span class="hs-identifier hs-var hs-var hs-var hs-var">foldl1</span></a></span></span><span> </span><span id="local-6989586621679072623"><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679072623"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072622"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072622"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; a) -&gt; f a -&gt; a
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; a -&gt; a) -&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#foldl1"><span class="hs-identifier hs-var">foldl1</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
</span><a href="#local-6989586621679072623"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072622"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-94"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#foldl1"><span class="hs-pragma hs-type">foldl1</span></a></span><span> </span><span class="hs-pragma">#-}</span><span class="hs-cpp">
#if MIN_VERSION_base(4,8,0)
</span><span>    </span><span id="local-6989586621679072620"><span class="annot"><span class="annottext">null :: forall a. Backwards f a -&gt; Bool
</span><a href="#local-6989586621679072620"><span class="hs-identifier hs-var hs-var hs-var hs-var">null</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072619"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072619"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">f a -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072619"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-97"></span><span>    </span><span id="local-6989586621679072617"><span class="annot"><span class="annottext">length :: forall a. Backwards f a -&gt; Int
</span><a href="#local-6989586621679072617"><span class="hs-identifier hs-var hs-var hs-var hs-var">length</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072616"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072616"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">f a -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072616"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-100"></span><span class="hs-comment">-- | Derived instance.</span><span>
</span><span id="line-101"></span><span id="local-6989586621679072939"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679072606"><span id="local-6989586621679072608"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Traversable.html#Traversable"><span class="hs-identifier hs-type">Traversable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679072939"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Traversable.html#Traversable"><span class="hs-identifier hs-type">Traversable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679072939"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-102"></span><span>    </span><span id="local-6989586621679072599"><span class="annot"><span class="annottext">traverse :: forall (f :: * -&gt; *) a b.
Applicative f =&gt;
(a -&gt; f b) -&gt; Backwards f a -&gt; f (Backwards f b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var hs-var hs-var hs-var">traverse</span></a></span></span><span> </span><span id="local-6989586621679072597"><span class="annot"><span class="annottext">a -&gt; f b
</span><a href="#local-6989586621679072597"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072596"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072596"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(f b -&gt; Backwards f b) -&gt; f (f b) -&gt; f (Backwards f b)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">f b -&gt; Backwards f b
forall {k} (f :: k -&gt; *) (a :: k). f a -&gt; Backwards f a
</span><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-var">Backwards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; f b) -&gt; f a -&gt; f (f b)
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; f b
</span><a href="#local-6989586621679072597"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679072596"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-103"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-pragma hs-type">traverse</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-104"></span><span>    </span><span id="local-6989586621679072590"><span class="annot"><span class="annottext">sequenceA :: forall (f :: * -&gt; *) a.
Applicative f =&gt;
Backwards f (f a) -&gt; f (Backwards f a)
</span><a href="../../base/src/Data.Traversable.html#sequenceA"><span class="hs-identifier hs-var hs-var hs-var hs-var">sequenceA</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span id="local-6989586621679072588"><span class="annot"><span class="annottext">f (f a)
</span><a href="#local-6989586621679072588"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(f a -&gt; Backwards f a) -&gt; f (f a) -&gt; f (Backwards f a)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">f a -&gt; Backwards f a
forall {k} (f :: k -&gt; *) (a :: k). f a -&gt; Backwards f a
</span><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-var">Backwards</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">f (f a) -&gt; f (f a)
forall (t :: * -&gt; *) (f :: * -&gt; *) a.
(Traversable t, Applicative f) =&gt;
t (f a) -&gt; f (t a)
</span><a href="../../base/src/Data.Traversable.html#sequenceA"><span class="hs-identifier hs-var">sequenceA</span></a></span><span> </span><span class="annot"><span class="annottext">f (f a)
</span><a href="#local-6989586621679072588"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-105"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/Data.Traversable.html#sequenceA"><span class="hs-pragma hs-type">sequenceA</span></a></span><span> </span><span class="hs-pragma">#-}</span></span><span class="hs-cpp">

#if MIN_VERSION_base(4,12,0)
</span><span class="hs-comment">-- | Derived instance.</span><span>
</span><span id="line-109"></span><span id="local-6989586621679072928"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679072585"><span class="annot"><a href="../../base/src/Data.Functor.Contravariant.html#Contravariant"><span class="hs-identifier hs-type">Contravariant</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679072928"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Contravariant.html#Contravariant"><span class="hs-identifier hs-type">Contravariant</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-type">Backwards</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679072928"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-110"></span><span>    </span><span id="local-6989586621679072582"><span class="annot"><span class="annottext">contramap :: forall a' a. (a' -&gt; a) -&gt; Backwards f a -&gt; Backwards f a'
</span><a href="../../base/src/Data.Functor.Contravariant.html#contramap"><span class="hs-identifier hs-var hs-var hs-var hs-var">contramap</span></a></span></span><span> </span><span id="local-6989586621679072580"><span class="annot"><span class="annottext">a' -&gt; a
</span><a href="#local-6989586621679072580"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">f a' -&gt; Backwards f a'
forall {k} (f :: k -&gt; *) (a :: k). f a -&gt; Backwards f a
</span><a href="Control.Applicative.Backwards.html#Backwards"><span class="hs-identifier hs-var">Backwards</span></a></span><span> </span><span class="annot"><span class="annottext">(f a' -&gt; Backwards f a')
-&gt; (Backwards f a -&gt; f a') -&gt; Backwards f a -&gt; Backwards f a'
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(a' -&gt; a) -&gt; f a -&gt; f a'
forall (f :: * -&gt; *) a' a.
Contravariant f =&gt;
(a' -&gt; a) -&gt; f a -&gt; f a'
</span><a href="../../base/src/Data.Functor.Contravariant.html#contramap"><span class="hs-identifier hs-var">contramap</span></a></span><span> </span><span class="annot"><span class="annottext">a' -&gt; a
</span><a href="#local-6989586621679072580"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(f a -&gt; f a') -&gt; (Backwards f a -&gt; f a) -&gt; Backwards f a -&gt; f a'
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Backwards f a -&gt; f a
forall {k} (f :: k -&gt; *) (a :: k). Backwards f a -&gt; f a
</span><a href="Control.Applicative.Backwards.html#forwards"><span class="hs-identifier hs-var hs-var">forwards</span></a></span><span>
</span><span id="line-111"></span><span>    </span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Contravariant.html#contramap"><span class="hs-pragma hs-type">contramap</span></a></span><span> </span><span class="hs-pragma">#-}</span></span><span class="hs-cpp">
#endif
</span></pre></body></html>